<?php
/**
 * FastApp.
 * 8/23/24
 * @Author deepsea159
 * @Contact telegram:deepsea159
 */

use Hyperf\Database\Seeders\Seeder;
use Hyperf\DbConnection\Db;

class Config extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $this->initConfig();
    }

    public function initConfig()
    {
        $data = [
            "INSERT INTO system_dict_type (id, name, code, status, created_by, updated_by, created_at, updated_at, deleted_at, remark) VALUES(108, '营销梯度类型', 'gradient_type', 1, 1, 1, '2024-09-23 07:08:45', '2024-09-23 07:08:45', NULL, NULL);",
            "INSERT INTO system_dict_data (id, type_id, label, value, code, sort, status, created_by, updated_by, created_at, updated_at, deleted_at, remark) VALUES(171, 108, '充值', 'recharge', 'gradient_type', 1, 1, 1, 1, '2024-09-23 07:09:31', '2024-09-23 07:09:31', NULL, NULL);",
            "INSERT INTO system_dict_data (id, type_id, label, value, code, sort, status, created_by, updated_by, created_at, updated_at, deleted_at, remark) VALUES(172, 108, '消费', 'expend', 'gradient_type', 1, 1, 1, 1, '2024-09-23 07:09:45', '2024-09-23 07:09:45', NULL, NULL);",
            "INSERT INTO system_dict_data (id, type_id, label, value, code, sort, status, created_by, updated_by, created_at, updated_at, deleted_at, remark) VALUES(173, 108, '邀请', 'invite', 'gradient_type', 1, 1, 1, 1, '2024-09-23 07:19:45', '2024-09-23 07:19:45', NULL, NULL);",

        ];
        foreach ($data as $sql) {
            try {
                Db::connection('default')->insert($sql);
            } catch (\Throwable) {
            }
        }

    }
}